<?PHP

	class tpl_managerooms {
		
		public static function managerooms(){
		
			if(empty($GLOBALS['OUTPUT']->rooms)){
				
				$room_html = <<<EOV
<tr>
	<td class='td2' colspan='3' style='text-align: center; font-style: italic'>{$GLOBALS['LANG']->lang_admin->no_rooms_found}</td>
</tr>
EOV;
			}else{
			
				$room_html = '';
				$class = 'td1';
				foreach($GLOBALS['OUTPUT']->rooms as $rname=>$rid){
					$class = ($class == 'td1' ? 'td2' : 'td1');

					$room_html .= <<<EOV
			<tr>
				<td class='{$class}'>{$rname}</td>
				<td class='{$class}'>
					<a href='./index.php?act=admin&page=editroom&rid={$rid}{$GLOBALS['OUTPUT']->ses}'>[{$GLOBALS['LANG']->lang_admin->edit}]</a> 
					<a href='./index.php?act=admin&page=managerooms&del={$rid}{$GLOBALS['OUTPUT']->ses}'>[{$GLOBALS['LANG']->lang_admin->delete}]</a>
				</td>
			</tr>
EOV;
			}
		}
			
			return	tpl_globals::header() .
<<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->managerooms}</div>
	<table style='width: 100%;' cellspacing='1' cellpadding='5'>
		<tr>
			<td class='table_header_row' width='80%'>{$GLOBALS['LANG']->lang_admin->roomname}</td>
			<td class='table_header_row' width='20%'>{$GLOBALS['LANG']->lang_admin->action}</td>
		</tr>
		{$room_html}
	</table>
	
	<br />
	
	<form action='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=managerooms' method='post'>
	
	<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->create_room}</div>
	<table style='width: 100%;' cellspacing='1' cellpadding='5'>
EOV
.
				$GLOBALS['OUTPUT']->form .
				<<<EOV
		<tr>
			<td colspan='2' style='text-align: center;' class='table_header_row'>
				<input type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
				<input type='button' onclick="document.location='./index.php?act=roomlist{$GLOBALS['OUTPUT']->ses}'" value='{$GLOBALS['LANG']->lang_roommgmt->roomlist}' class='form_button_norm' onmouseout="this.className='form_button_norm'" onmouseover="this.className='form_button_over'">
			</td>
		</tr>
	</table>
	
	</form>
EOV
.
			tpl_globals::footer();
				
		}
		
	}

?>